<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script>
	
	// 编写函数repeat(char,n) 实现重复char字符串n次
	// 比如repeat("★",6) 返回"★★★★★★"
	
	function repeat(char , n){
		
		let str = '';
		
		for(let i = 0; i < n; i++){
			str = str.concat(char);
		}
		return str;
	}
	
	console.log(repeat('*',6));
	
	
	// ES6
	console.log('*'.repeat(6));
	
</script>